﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MDIApplication
{
    public partial class HousekeepingSchedule : Form
    {
        public HousekeepingSchedule()
        {
            InitializeComponent();
        }

        private void HousekeepingSchedule_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'HSRptDataSet.Staff' table. You can move, or remove it, as needed.
            this.StaffTableAdapter.Fill(this.HSRptDataSet.Staff);
            this.reportViewer1.RefreshReport();

        }

        private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
        {
            lblcalendar.Text = monthCalendar1.SelectionStart.ToLongDateString();
            this.StaffTableAdapter.FillByDate(this.HSRptDataSet.Staff, Convert.ToString(monthCalendar1.SelectionStart));
            this.reportViewer1.RefreshReport();
        }

        private void cbmonth_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.StaffTableAdapter.FillByMonth(this.HSRptDataSet.Staff, Convert.ToDecimal(cbmonth.Text));
            this.reportViewer1.RefreshReport();
        }

        private void cbyear_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.StaffTableAdapter.FillByYear(this.HSRptDataSet.Staff, Convert.ToDecimal(cbyear.Text));
            this.reportViewer1.RefreshReport();
        }

        private void btnviewall_Click(object sender, EventArgs e)
        {
            this.StaffTableAdapter.Fill(this.HSRptDataSet.Staff);
            this.reportViewer1.RefreshReport();
        }
    }
}
